package co.yixiang.upms.common.system.hystrix;


import co.yixiang.upms.common.system.feign.RemoteUserService;
import feign.hystrix.FallbackFactory;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

/**
 * 用户服务降级处理
 * @author yshop
 */
@Component
public class  RemoteUserFallbackFactory implements FallbackFactory<RemoteUserService>
{
    private static final Logger  log = LoggerFactory.getLogger(RemoteUserFallbackFactory.class);

    @Override
    public RemoteUserService create(Throwable throwable)
    {
        log.error("用户服务调用失败:{}", throwable.getMessage());
        return  null;
    }
}
